[#import "/base/spring.ftl" as spring /]
<!--定义企业类型-->
[#assign grade={"1":"大型","2":"中型","3":"小型","3":"微型"}/]
<!DOCTYPE html>
<html lang="en">
  <head>
    [#include "/base/base.ftl"/]
  </head>

  <body>

  <section id="container" class="">
      <!--header start-->
      [#include "/base/header.ftl"/]
      <!--header end-->
      <!--sidebar start-->
       [#include "/base/left.ftl"/]
      <!--sidebar end-->
      <!--main content start-->
      <section id="main-content">
          <section class="wrapper">
              <!-- page start-->
              <div class="row">
                  <div class="col-lg-12">
                      <section class="panel">
                          [#include "/base/crumbs.ftl"/]
                          <div class="panel-body">
                              <form class="form-horizontal tasi-form" method="post">
                                  <div class="form-group">
                                      <label class="col-sm-2 col-sm-2 control-label">政策标题</label>
                                      <div class="col-sm-4">
                                      [@spring.formInput "policyBase.title",'class="form-control"'/]
                                      </div>
                                       <div class="col-sm-4 messageTip">
                                   		    <span>政策标题100个字符以内</span>
                                            [@spring.showErrors /]
                                      </div>
                                  </div>
                                   <div class="form-group">
                                      <label class="col-sm-2 control-label col-lg-2" for="inputSuccess">主管部门</label>
                                      <div class="col-lg-4">
                                          <select class="form-control m-bot15" name="competent_department_name">
                                          [#list departlist as depart]
                                          		[#if depart.type == 1]
                                          			[#if policyBase.competent_department == depart.id]
                                          			 	<option value="${depart.name},${depart.id}" selected="selected">${depart.name}</option>
                                          			 	[#else]
                                          			 	<option value="${depart.name},${depart.id}">${depart.name}</option>
                                          			[/#if]
                                          		[/#if]
                                          [/#list]
                                          
                                          </select>
                                      </div>
                                  </div>
                                   <div class="form-group">
                                      <label class="col-sm-2 control-label col-lg-2" for="inputSuccess">申报部门</label>
                                      <div class="col-lg-4">
                                          <select class="form-control m-bot15" name="declaration_departmnt_name">
                                           [#list departlist as depart]
                                          		[#if depart.type == 2]
                                          			[#if policyBase.competent_department == depart.id]
                                          			 	<option value="${depart.name},${depart.id}" selected="selected">${depart.name}</option>
                                          			 	[#else]
                                          			 	<option value="${depart.name},${depart.id}">${depart.name}</option>
                                          			[/#if]
                                          		[/#if]
                                          [/#list]
                                          </select>
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label class="col-sm-2 control-label col-lg-2" for="inputSuccess">咨询部门</label>
                                      <div class="col-lg-4">
                                          <select class="form-control m-bot15" name="advisory_department_name">
                                          [#list departlist as depart]
                                          		[#if depart.type == 3]
                                          			[#if policyBase.competent_department == depart.id]
                                          			 	<option value="${depart.name},${depart.id}" selected="selected">${depart.name}</option>
                                          			 	[#else]
                                          			 	<option value="${depart.name},${depart.id}">${depart.name}</option>
                                          			[/#if]
                                          		[/#if]
                                          [/#list]
                                          </select>
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label class="col-sm-2 col-sm-2 control-label">申报时间区间</label>
                                      <div class="col-sm-2">
                                      [@spring.formInput "policyBase.beg_times",'class="form-control"'/]
                                      </div>
                                       <div class="col-sm-2 messageTip">
                                      	 [@spring.formInput "policyBase.end_times",'class="form-control"'/]
                                      </div>
                                  </div>
                                   <div class="form-group">
                                      <label class="col-sm-2 control-label col-lg-2" for="inputSuccess">项目范围</label>
                                      <div class="col-lg-2">
                                          <select class="form-control m-bot15" name="fist_city_name" id = "fist_city_name" onchange="fist_change(this)">
                                          				[#if policyBase.fist_city ==0]
                                          					<option value="全部,0" selected="selected">全部</option>
                                          					[#else]
                                          					<option value="全部,0">全部</option>
                                          				[/#if]
                                          </select>
                                      </div>
                                      <div class="col-lg-2">
                                          <select class="form-control m-bot15" name="secen_city_name" id="secen_city_name" onchange="seced_change(this)">
                                          				[#if policyBase.secen_city ==0]
                                          					<option value="全部,0" selected="selected">全部</option>
                                          					[#else]
                                          					<option value="全部,0">全部</option>
                                          				[/#if]
                                          </select>
                                      </div>
                                       <div class="col-lg-2">
                                          <select class="form-control m-bot15" name="threed_city_name" id = "threed_city_name">
                                          				[#if policyBase.threed_city ==1]
                                          					<option value="全部,0" selected="selected">全部</option>
                                          					[#else]
                                          					<option value="全部,0">全部</option>
                                          				[/#if]
                                          </select>
                                      </div>
                                  </div>
                                   <div class="form-group">
                                      <label class="col-sm-2 control-label col-lg-2" for="inputSuccess">企业类型</label>
                                      <div class="col-lg-2">
                                          <select class="form-control m-bot15" name="fist_enterprise_name" id = "fist_enterprise_name" onchange="secend_enterprise(this)">
                                          				[#if policyBase.fist_enterprise ==0]
                                          					<option value="全部,0" selected="selected">全部</option>
                                          					[#else]
                                          					<option value="全部,0">全部</option>
                                          				[/#if]
                                          </select>
                                      </div>
                                      <div class="col-lg-2">
                                          <select class="form-control m-bot15" name="secend_enterprise_name" id="secend_enterprise_name" onchange="threed_enterprise(this)">
                                          				[#if policyBase.secend_enterprise ==0]
                                          					<option value="全部,0" selected="selected">全部</option>
                                          					[#else]
                                          					<option value="全部,0">全部</option>
                                          				[/#if]
                                          </select>
                                      </div>
                                       <div class="col-lg-2">
                                          <select class="form-control m-bot15" name="threed_enterprise_name" id = "threed_enterprise_name" onchange="four_enterprise(this)">
                                          				[#if policyBase.threed_enterprise ==0]
                                          					<option value="全部,0" selected="selected">全部</option>
                                          					[#else]
                                          					<option value="全部,0">全部</option>
                                          				[/#if]
                                          </select>
                                      </div>
                                       <div class="col-lg-2">
                                          <select class="form-control m-bot15" name="fuor_enterprise_name" id = "fuor_enterprise_name">
                                          				[#if policyBase.fuor_enterprise ==0]
                                          					<option value="全部,0" selected="selected">全部</option>
                                          					[#else]
                                          					<option value="全部,0">全部</option>
                                          				[/#if]
                                          </select>
                                      </div>
                                  </div>
                                   <div class="form-group">
                                      <label class="col-sm-2 control-label col-lg-2" for="inputSuccess">企业规模</label>
                                      <div class="col-lg-4">
                                          <select class="form-control m-bot15" name="enterprise_scale">
                                          				[#if policyBase.enterprise_scale ==1]
                                          					<option value="1" selected="selected">大型</option>
                                          					[#else]
                                          					<option value="1">大型</option>
                                          				[/#if]
                                          				[#if policyBase.enterprise_scale ==2]
                                          					<option value="2" selected="selected">中型</option>
                                          					[#else]
                                          					<option value="2">中型</option>
                                          				[/#if]
                                          				[#if policyBase.enterprise_scale ==3]
                                          					<option value="3" selected="selected">小型</option>
                                          					[#else]
                                          					<option value="3">小型</option>
                                          				[/#if]
                                          				[#if policyBase.enterprise_scale ==4]
                                          					<option value="4" selected="selected">微型</option>
                                          					[#else]
                                          					<option value="4">微型</option>
                                          				[/#if]
                                          </select>
                                      </div>
                                  </div>
                                  
                                  
                                  <div class="form-group">
                                          <label class="col-lg-2 control-label">享受政策</label>
                                          <div class="col-lg-4">
                                           [@spring.formTextarea "policyBase.enjoy_the_policy",'cols="72" rows="5"'/]
                                          </div>
                                          <div class="col-lg-4">
                                              	享受政策在1000个字符以内[@spring.showErrors /]
                                          </div>
                                  </div>
                                  
                                  <div class="form-group">
                                          <label class="col-lg-2 control-label">申报条件</label>
                                          <div class="col-lg-4">
                                           [@spring.formTextarea "policyBase.conditions_of_declaration",'cols="72" rows="5"'/]
                                          </div>
                                          <div class="col-lg-4">
                                              	申报条件在1000个字符以内[@spring.showErrors /]
                                          </div>
                                  </div>
                                  
                                   <div class="form-group">
                                          <label class="col-lg-2 control-label">项目后续管理</label>
                                          <div class="col-lg-4">
                                           [@spring.formTextarea "policyBase.project_follow_up_management",'cols="72" rows="5"'/]
                                          </div>
                                          <div class="col-lg-4">
                                              	项目后续管理在1000个字符以内[@spring.showErrors /]
                                          </div>
                                  </div>
                                  
                                  
                                   <div class="form-group">
                                      <div class="col-lg-offset-2 col-lg-10">
                                          <button class="btn btn-danger" type="submit">Submit</button>
                                      </div>
                                  </div>
                                  
                              </form>
                          </div>
                      </section>
                  </div>
              </div>
              <!-- page end-->
          </section>
      </section>
      <!--main content end-->
      <!--footer start-->
      [#include "/base/footer.ftl"/]
      <!--footer end-->
  </section>

    <!-- js placed at the end of the document so the pages load faster -->
    <script src="${base}/js/jquery.js"></script>
    <script src="${base}/js/bootstrap.min.js"></script>
    <script src="${base}/js/jquery.scrollTo.min.js"></script>
    <script src="${base}/js/jquery.nicescroll.js" type="text/javascript"></script>

    <script src="${base}/js/jquery-ui-1.9.2.custom.min.js"></script>
    <script class="include" type="text/javascript" src="${base}/js/jquery.dcjqaccordion.2.7.js"></script>

  <!--custom switch-->
  <script src="${base}/js/bootstrap-switch.js"></script>
  <!--custom tagsinput-->
  <script src="${base}/js/jquery.tagsinput.js"></script>
  <!--custom checkbox & radio-->
  <script type="text/javascript" src="${base}/js/ga.js"></script>

  <script type="text/javascript" src="${base}/assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
  <script type="text/javascript" src="${base}/assets/bootstrap-daterangepicker/date.js"></script>
  <script type="text/javascript" src="${base}/assets/bootstrap-daterangepicker/daterangepicker.js"></script>
  <script type="text/javascript" src="${base}/assets/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
  <script type="text/javascript" src="${base}/assets/ckeditor/ckeditor.js"></script>

  <script type="text/javascript" src="${base}/assets/bootstrap-inputmask/bootstrap-inputmask.min.js"></script>
  <script src="${base}/js/respond.min.js" ></script>


  <!--common script for all pages-->
    <script src="${base}/js/common-scripts.js"></script>

  <!--script for this page-->
  <script src="${base}/js/form-component.js"></script>
<script>

 function fist_change(city_id){
			   	 var select_value =  $("#fist_city_name").val();
				var id = select_value.split(",")[1];
		$.ajax({
				url:"${base}/mapInfo/secendLeve",
				dataType:"json",
				type:"get",
				data:{"fistCode":id},
				success:function(data){
				$("#secen_city_name > option").remove();
				$("#secen_city_name").append('<option value="全部,0">全部</option>');
					var list = data;
					for(var i= 0 ;i<=list.length; i++){
					try{
					$("#secen_city_name").append('<option value="'+list[i].city_name+','+list[i].ids+'">'+list[i].city_name+'</option>');
					}catch(err){
					
					}
					
					}
				}
	});
			   	 
			   	 
			   }
			   
function seced_change(){
		 var thre_value =  $("#secen_city_name").val();
		 var id = thre_value.split(",")[1];
		 $.ajax({
				url:"${base}/mapInfo/threeLeve",
				dataType:"json",
				type:"get",
				data:{"secendCode":id},
				success:function(data){
				$("#threed_city_name > option").remove();
				$("#threed_city_name").append('<option value="全部,0">全部</option>');
					var list = data;
					for(var i= 0 ;i<=list.length; i++){
					try{
					$("#threed_city_name").append('<option value="'+list[i].city_name+','+list[i].ids+'">'+list[i].city_name+'</option>');
					}catch(err){
					}
					}
				}
	});
	
}			   

function secend_enterprise(){
	 var thre_value =  $("#fist_enterprise_name").val();
		 var id = thre_value.split(",")[1];
		 $.ajax({
				url:"${base}/unitCategory/secendLeve",
				dataType:"json",
				type:"get",
				data:{"fistCode":id},
				success:function(data){
				$("#secend_enterprise_name > option").remove();
				$("#secend_enterprise_name").append('<option value="全部,0">全部</option>');
					var list = data;
					for(var i= 0 ;i<=list.length; i++){
					$("#secend_enterprise_name").append('<option value="'+list[i].name+','+list[i].code+'">'+list[i].name+'</option>');
					}
				}
	});
	
	
	}	
	
function threed_enterprise(){
	 var thre_value =  $("#secend_enterprise_name").val();
		 var id = thre_value.split(",")[1];
		 $.ajax({
				url:"${base}/unitCategory/threeLeve",
				dataType:"json",
				type:"get",
				data:{"secendCode":id},
				success:function(data){
				$("#threed_enterprise_name > option").remove();
				$("#threed_enterprise_name").append('<option value="全部,0">全部</option>');
					var list = data;
					for(var i= 0 ;i<=list.length; i++){
					$("#threed_enterprise_name").append('<option value="'+list[i].name+','+list[i].code+'">'+list[i].name+'</option>');
					}
				}
	});
	
	
	}

function four_enterprise(){
	 var thre_value =  $("#threed_enterprise_name").val();
		 var id = thre_value.split(",")[1];
		 $.ajax({
				url:"${base}/unitCategory/fourLeve",
				dataType:"json",
				type:"get",
				data:{"threedCode":id},
				success:function(data){
				$("#fuor_enterprise_name > option").remove();
				$("#fuor_enterprise_name").append('<option value="全部,0">全部</option>');
					var list = data;
					for(var i= 0 ;i<=list.length; i++){
					$("#fuor_enterprise_name").append('<option value="'+list[i].name+','+list[i].code+'">'+list[i].name+'</option>');
					}
				}
	});
	
	
	}

	   	   
			
	//加载所有的一级城市信息
	$(document).ready(function(){ 
	var fist_city_id = '${policyBase.fist_city}';
			　	$.ajax({
						url:"${base}/mapInfo/fistLeve",
						dataType:"json",
						type:"get",
						success:function(data){
							var list = data;
							for(var i= 0 ;i<=list.length; i++){
							try{
							var name = list[i].city_name;
							if(fist_city_id == list[i].ids){
							$("#fist_city_name").append('<option selected="selected" value="'+name+','+list[i].ids+'">'+name+'</option>');
							}else{
							$("#fist_city_name").append('<option value="'+name+','+list[i].ids+'">'+name+'</option>');
							}
							}
							catch(err){
							}
							}
							
							update_city_load();
						}
			   });
			   //加载一级企业名称
			   var fist_code_id = '${policyBase.fist_enterprise}';
			   $.ajax({
						url:"${base}/unitCategory/fistLeve",
						dataType:"json",
						type:"get",
						success:function(data){
							var list = data;
							for(var i= 0 ;i<=list.length; i++){
							try{
							var name = list[i].name;
							if(fist_code_id == list[i].code){
							$("#fist_enterprise_name").append('<option selected="selected" value="'+name+','+list[i].code+'">'+name+'</option>');
							}else{
							$("#fist_enterprise_name").append('<option value="'+name+','+list[i].code+'">'+name+'</option>');
							}
								
							}
							catch(err){
							}
							}
							bus_load();
						}
			   });
}); 

function update_city_load(){
		//二级城市加载
				var id = '${policyBase.fist_city}';
				var secend_id = '${policyBase.secen_city}';
		$.ajax({
				url:"${base}/mapInfo/secendLeve",
				dataType:"json",
				type:"get",
				data:{"fistCode":id},
				success:function(data){
				$("#secen_city_name > option").remove();
				$("#secen_city_name").append('<option value="全部,0">全部</option>');
					var list = data;
					for(var i= 0 ;i<=list.length; i++){
					try{
					if(secend_id == list[i].ids){
						$("#secen_city_name").append('<option selected="selected" value="'+list[i].city_name+','+list[i].ids+'">'+list[i].city_name+'</option>');
					}else{
						$("#secen_city_name").append('<option value="'+list[i].city_name+','+list[i].ids+'">'+list[i].city_name+'</option>');
					}
					}catch(err){
					}
					}
				}
	});
	//三级城市加载
	var secend_id = '${policyBase.secen_city}';
	var threed_id = '${policyBase.threed_city}';
	$.ajax({
				url:"${base}/mapInfo/threeLeve",
				dataType:"json",
				type:"get",
				data:{"secendCode":secend_id},
				success:function(data){
				$("#threed_city_name > option").remove();
				$("#threed_city_name").append('<option value="全部,0">全部</option>');
					var list = data;
					for(var i= 0 ;i<=list.length; i++){
					try{
					if(threed_id == list[i].ids){
						$("#threed_city_name").append('<option selected="selected" value="'+list[i].city_name+','+list[i].ids+'">'+list[i].city_name+'</option>');
					}else{
						$("#threed_city_name").append('<option value="'+list[i].city_name+','+list[i].ids+'">'+list[i].city_name+'</option>');
					}
					}catch(err){
					}
					}
	}
	});



}

function bus_load(){

//二级企业加载
 var thre_value =  '${policyBase.fist_enterprise}';
 var threed_value = '${policyBase.secend_enterprise}';
		 $.ajax({
				url:"${base}/unitCategory/secendLeve",
				dataType:"json",
				type:"get",
				data:{"fistCode":thre_value},
				success:function(data){
				$("#secend_enterprise_name > option").remove();
				$("#secend_enterprise_name").append('<option value="全部,0">全部</option>');
					var list = data;
					for(var i= 0 ;i<=list.length; i++){
					try{
					if(threed_value = list[i].code){
					$("#secend_enterprise_name").append('<option selected="selected" value="'+list[i].name+','+list[i].code+'">'+list[i].name+'</option>');
					}else{
					$("#secend_enterprise_name").append('<option value="'+list[i].name+','+list[i].code+'">'+list[i].name+'</option>');
					}
					}catch(err){
					
					}
					}
				}
	});
//三级企业加载
var sss_value = '${policyBase.threed_enterprise}';
var thre_value =  threed_value;
		 $.ajax({
				url:"${base}/unitCategory/threeLeve",
				dataType:"json",
				type:"get",
				data:{"secendCode":thre_value},
				success:function(data){
				$("#threed_enterprise_name > option").remove();
				$("#threed_enterprise_name").append('<option value="全部,0">全部</option>');
					var list = data;
					for(var i= 0 ;i<=list.length; i++){
					try{
						if(sss_value == list[i].code){
						$("#threed_enterprise_name").append('<option selected="selected" value="'+list[i].name+','+list[i].code+'">'+list[i].name+'</option>');
						}else{
						$("#threed_enterprise_name").append('<option value="'+list[i].name+','+list[i].code+'">'+list[i].name+'</option>');
						}
					}catch(err){
					
					}
					
					}
				}
	});
	
//四级企业加载
var for_values = '${policyBase.fuor_enterprise}';
	 var thre_value =  sss_value;
		 $.ajax({
				url:"${base}/unitCategory/fourLeve",
				dataType:"json",
				type:"get",
				data:{"threedCode":thre_value},
				success:function(data){
				$("#fuor_enterprise_name > option").remove();
				$("#fuor_enterprise_name").append('<option value="全部,0">全部</option>');
					var list = data;
					for(var i= 0 ;i<=list.length; i++){
					try{
						if(for_values == list[i].code){
						$("#fuor_enterprise_name").append('<option selected="selected" value="'+list[i].name+','+list[i].code+'">'+list[i].name+'</option>');
						}else{
						$("#fuor_enterprise_name").append('<option value="'+list[i].name+','+list[i].code+'">'+list[i].name+'</option>');
						}
					}catch(err){
					
					}
					}
				}
	});
}





</script>
<script type="text/javascript" src="${base}/css/layDate-v5.0.9/laydate/laydate.js"></script>
     <script>
     //日期范围
     
     laydate.render({
  		elem: '#beg_times'
});

laydate.render({
  elem: '#end_times'
});
     </script>
  </body>
</html>
